package bishe;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

public class logincheck {
	public static boolean admincheck(String id, String password) throws IOException {
		BufferedReader in = new BufferedReader(new FileReader("admin.txt"));
		boolean a = false;
		String str = null;
		while ((str = in.readLine()) != null) {
			String[] st = str.split(" ");
			if (st[0].equals(id) && st[1].equals(password)) {
				a = true;
			}
		}
		in.close();
		return a;
	}

	public static boolean usercheck(String id, String password) throws IOException {
		BufferedReader in = new BufferedReader(new FileReader("user.txt"));
		boolean a = false;
		String str = null;
		while ((str = in.readLine()) != null) {
			String[] st = str.split(" ");
			if (st[0].equals(id) && st[1].equals(password)) {
				a = true;
			}
		}
		in.close();
		return a;
	}

}
